<%@ Page Language="C#" MasterPageFile="AdminMasterPage.master" AutoEventWireup="true" CodeFile="Content.aspx.cs" Inherits="Admin_Content" Title="Untitled Page" ValidateRequest="false" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:Personal %>"
        DeleteCommand="DELETE FROM [Content] WHERE [id] = @id"
        InsertCommand="INSERT INTO [Content] ([pageName], [itemName], [itemContent], [itemTitle], [itemCaption], [ImageName], [itemSerial], [isPublished]) VALUES (@pageName, @itemName, @itemContent, @itemTitle, @itemCaption, @ImageName, @itemSerial, @isPublished)"
        ProviderName="<%$ ConnectionStrings:Personal.ProviderName %>"
        SelectCommand="SELECT [pageName], [itemName], [itemContent], [itemTitle], [itemCaption], [ImageName], [itemSerial], [isPublished], [id] FROM [Content]"
        UpdateCommand="UPDATE [Content] SET [pageName] = @pageName, [itemName] = @itemName, [itemContent] = @itemContent, [itemTitle] = @itemTitle, [itemCaption] = @itemCaption, [ImageName] = @ImageName, [itemSerial] = @itemSerial, [isPublished] = @isPublished WHERE [id] = @id">
        <InsertParameters>
            <asp:Parameter Name="pageName" Type="String" />
            <asp:Parameter Name="itemName" Type="String" />
            <asp:Parameter Name="itemContent" Type="String" />
            <asp:Parameter Name="itemTitle" Type="String" />
            <asp:Parameter Name="itemCaption" Type="String" />
            <asp:Parameter Name="ImageName" Type="String" />
            <asp:Parameter Name="itemSerial" Type="String" />
            <asp:Parameter Name="isPublished" Type="Boolean" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="pageName" Type="String" />
            <asp:Parameter Name="itemName" Type="String" />
            <asp:Parameter Name="itemContent" Type="String" />
            <asp:Parameter Name="itemTitle" Type="String" />
            <asp:Parameter Name="itemCaption" Type="String" />
            <asp:Parameter Name="ImageName" Type="String" />
            <asp:Parameter Name="itemSerial" Type="String" />
            <asp:Parameter Name="isPublished" Type="Boolean" />
            <asp:Parameter Name="id" Type="Int32" />
        </UpdateParameters>
        <DeleteParameters>
            <asp:Parameter Name="id" Type="Int32" />
        </DeleteParameters>
    </asp:SqlDataSource>
    &nbsp; &nbsp;
    <asp:DetailsView ID="DetailsView1" runat="server" AllowPaging="True" AutoGenerateRows="False"
        DataKeyNames="id" DataSourceID="SqlDataSource1" Height="14px" Width="613px">
        <Fields>
            <asp:BoundField DataField="pageName" HeaderText="pageName" SortExpression="pageName" />
            <asp:BoundField DataField="itemName" HeaderText="itemName" SortExpression="itemName" />
            <asp:TemplateField HeaderText="itemContent" SortExpression="itemContent">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server" Height="200px" Text='<%# Bind("itemContent") %>'
                        TextMode="MultiLine" Width="570px"></asp:TextBox>
                </EditItemTemplate>
                <InsertItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server" Height="200px" Text='<%# Bind("itemContent") %>'
                        TextMode="MultiLine" Width="570px"></asp:TextBox>
                </InsertItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("itemContent") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="itemTitle" HeaderText="itemTitle" SortExpression="itemTitle" />
            <asp:BoundField DataField="itemCaption" HeaderText="itemCaption" SortExpression="itemCaption" />
            <asp:BoundField DataField="ImageName" HeaderText="ImageName" SortExpression="ImageName" />
            <asp:BoundField DataField="itemSerial" HeaderText="itemSerial" SortExpression="itemSerial" />
            <asp:CheckBoxField DataField="isPublished" HeaderText="isPublished" SortExpression="isPublished" />
            <asp:BoundField DataField="id" HeaderText="id" InsertVisible="False" ReadOnly="True"
                SortExpression="id" />
            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" ShowInsertButton="True" />
        </Fields>
    </asp:DetailsView>
    <br />
    <br />
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"
        AutoGenerateColumns="False" DataKeyNames="id" DataSourceID="SqlDataSource1" Width="592px">
        <Columns>
            <asp:CommandField ShowDeleteButton="True" />
            <asp:BoundField DataField="pageName" HeaderText="pageName" SortExpression="pageName" />
            <asp:BoundField DataField="itemName" HeaderText="itemName" SortExpression="itemName" />
            <asp:BoundField DataField="itemTitle" HeaderText="itemTitle" SortExpression="itemTitle" />
            <asp:BoundField DataField="itemCaption" HeaderText="itemCaption" SortExpression="itemCaption" />
            <asp:BoundField DataField="ImageName" HeaderText="ImageName" SortExpression="ImageName" />
            <asp:BoundField DataField="itemSerial" HeaderText="itemSerial" SortExpression="itemSerial" />
            <asp:CheckBoxField DataField="isPublished" HeaderText="isPublished" SortExpression="isPublished" />
            <asp:BoundField DataField="id" HeaderText="id" InsertVisible="False" ReadOnly="True"
                SortExpression="id" />
        </Columns>
    </asp:GridView>
    <br />
    <br />
    <br />
    <br />
    <br />
             <br />

</asp:Content>

